/**
 * author:Administrator
 * date:2016/1/4
 * desc:TODO
 */

'use strict';

var Router = require('koa-router');
var __pathPrefix = '/reset';
var router = new Router({prefix: __pathPrefix});
module.exports = router.routes();

var biz = require('../biz/reset.js');

var defQty = 10;
// get /reset?qty=111
router.get('/', function*() {
  var qty = this.request.inParams.fields.qty;
  if (typeof qty === 'undefined' || isNaN(qty)) {
    qty = defQty;
  }
  var retObj = yield biz.reset(qty);
  this.body = retObj.errcode == 0 ? 'reset done' : 'reset error';
});


